// 自定义hook
import { getChannels } from "@/store/actions/article";
import { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";

const useChannels = () => {
    const dispatch = useDispatch()
    const channels = useSelector(state => state.article.channels)
    useEffect(() => {
        dispatch(getChannels())
    }, [dispatch])
    return channels
}

export { useChannels }